<template>
  <div id="app">
    <div id="nav">
      <router-link to="/">首页</router-link> |
      <router-link to="/about">关于</router-link> |
      <router-link to="/Download">下载</router-link> |

      <!--
      <router-link :to="'/User/'+UserID">用户</router-link>| 
      <router-link :to="{path: '/Profile',query: {name: 'why',age:18}}">档案</router-link>
      -->
      <br>
      <button @click="userclick()">用户</button>
      <button @click="profileclick()">档案</button>

    </div>

    <keep-alive>
      <router-view/>
    </keep-alive>
    
  </div>
</template>

<style>

</style>

<script>
  export default {
    data() {
      return {
        UserID: "小明"
      }
    },
    methods: {
      userclick() {
        this.$router.push('/User/' + this.UserID)
      },
      profileclick() {
        this.$router.push({
          path: '/Profile',
          query: {
            name: "why",
            age: 18,
          }

        })
      },
    }
  }
</script>